/*
 * TagLong.cpp
 *
 *  Created on: 18 juin 2011
 *      Author: Pierrick Caillon <pierrick@megami.fr>
 */

#include "TagLong.h"

/* NAMEDTAG_H_ */
namespace NamedBinaryTag
{
    TagLong::TagLong()
    :NamedTag(), value(0)
    {
    }

    TagLong::~TagLong()
    {
    }

    void TagLong::set_Value(int64_t value)
    {
        this->value = value;
    }

    TagTypes TagLong::get_TagType() const
    {
        return TAG_LONG;
    }

    int64_t TagLong::get_Value() const
    {
        return this->value;
    }

    void TagLong::Read(std::istream & input, bool ignoreName)
    {
        NamedTag::Read(input, ignoreName);
        ReadData(input, (char*)((&this->value)));
    }

    void TagLong::Write(std::ostream & output, bool ignoreName) const
    {
        NamedTag::Write(output, ignoreName);
        WriteData(output, (const char*)((&this->value)));
    }

    ITag *TagLong::clone() const
    {
    	return this->clone(NULL);
    }

    ITag *TagLong::clone(void *newRoot) const
    {
        TagLong *copy = new TagLong(newRoot);
        copy->value = this->value;
        return copy;
    }

}
